
test_one.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <test1>:
#include <stdio.h>
#include <string.h>


int test1()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd010 	sub	sp, sp, #16
	char string[10];
	char *str = "0123456789";
   c:	e59f3020 	ldr	r3, [pc, #32]	; 34 <test1+0x34>
  10:	e50b3008 	str	r3, [fp, #-8]
	
	strcpy(string, str);	// overflow
  14:	e24b3014 	sub	r3, fp, #20
  18:	e51b1008 	ldr	r1, [fp, #-8]
  1c:	e1a00003 	mov	r0, r3
  20:	ebfffffe 	bl	0 <strcpy>
	
	return 0;
  24:	e3a03000 	mov	r3, #0
}
  28:	e1a00003 	mov	r0, r3
  2c:	e24bd004 	sub	sp, fp, #4
  30:	e8bd8800 	pop	{fp, pc}
  34:	00000000 	.word	0x00000000

00000038 <test2>:

void test2()
{
  38:	e92d4800 	push	{fp, lr}
  3c:	e28db004 	add	fp, sp, #4
  40:	e24dd020 	sub	sp, sp, #32
	char string[10], str1[10];
	int i;
	
	for (i = 0; i < 10; i++)
  44:	e3a03000 	mov	r3, #0
  48:	e50b3008 	str	r3, [fp, #-8]
  4c:	ea000007 	b	70 <test2+0x38>
		str1[i] = 'a';	// buneng jieshu, 
  50:	e24b2020 	sub	r2, fp, #32
  54:	e51b3008 	ldr	r3, [fp, #-8]
  58:	e0823003 	add	r3, r2, r3
  5c:	e3a02061 	mov	r2, #97	; 0x61
  60:	e5c32000 	strb	r2, [r3]
void test2()
{
	char string[10], str1[10];
	int i;
	
	for (i = 0; i < 10; i++)
  64:	e51b3008 	ldr	r3, [fp, #-8]
  68:	e2833001 	add	r3, r3, #1
  6c:	e50b3008 	str	r3, [fp, #-8]
  70:	e51b3008 	ldr	r3, [fp, #-8]
  74:	e3530009 	cmp	r3, #9
  78:	dafffff4 	ble	50 <test2+0x18>
		str1[i] = 'a';	// buneng jieshu, 
		
	strcpy(string, str1);	// copy zijie shu bu queding.   strcpy yi '\0' jieshu.
  7c:	e24b2020 	sub	r2, fp, #32
  80:	e24b3014 	sub	r3, fp, #20
  84:	e1a01002 	mov	r1, r2
  88:	e1a00003 	mov	r0, r3
  8c:	ebfffffe 	bl	0 <strcpy>
}
  90:	e24bd004 	sub	sp, fp, #4
  94:	e8bd8800 	pop	{fp, pc}

00000098 <test3>:

void test3(char *str)
{
  98:	e92d4800 	push	{fp, lr}
  9c:	e28db004 	add	fp, sp, #4
  a0:	e24dd018 	sub	sp, sp, #24
  a4:	e50b0018 	str	r0, [fp, #-24]	; 0xffffffe8
	char string[10];
	
	if (strlen(str) <= 10)	// modify < 10
  a8:	e51b0018 	ldr	r0, [fp, #-24]	; 0xffffffe8
  ac:	ebfffffe 	bl	0 <strlen>
  b0:	e1a03000 	mov	r3, r0
  b4:	e353000a 	cmp	r3, #10
  b8:	8a000003 	bhi	cc <test3+0x34>
		strcpy(string, str);
  bc:	e24b3010 	sub	r3, fp, #16
  c0:	e51b1018 	ldr	r1, [fp, #-24]	; 0xffffffe8
  c4:	e1a00003 	mov	r0, r3
  c8:	ebfffffe 	bl	0 <strcpy>
}
  cc:	e24bd004 	sub	sp, fp, #4
  d0:	e8bd8800 	pop	{fp, pc}

000000d4 <main>:

int main()
{
  d4:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
  d8:	e28db000 	add	fp, sp, #0
	
}
  dc:	e1a00003 	mov	r0, r3
  e0:	e24bd000 	sub	sp, fp, #0
  e4:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
  e8:	e12fff1e 	bx	lr
